package cn.ssj.controller;

import cn.ssj.entity.Statistics;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
@EnableAutoConfiguration
public class StatisticsController extends BaseController<Statistics,Integer> {

    @RequestMapping("/back/addStatistics")
    public String add(Statistics entity) {
        return super.add(entity);
    }

    @RequestMapping("/back/updateStatistics")
    public String update(Statistics entity) {
        return super.update(entity);
    }

    @RequestMapping("/back/deleteStatistics")
    public String delete(@RequestParam("ids[]")Integer[] integers) {
        return super.delete(integers);
    }

    @RequestMapping("/back/queryAllStatisticsByPage")
    public String queryAllByPage(Integer pageNumber) {
        return super.queryAllByPage(pageNumber);
    }

    @RequestMapping("/back/statistiscUpload")
    public String upload(MultipartFile file, HttpServletRequest request) {
        super.setLocationPath(getLocationPath()+ "statistics");
        super.setHandlerPath(getHandlerPath()+"statistics");
        return super.upload(file, request);
    }
}
